package com.gridmobi.xrtb.model.rtb;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author huangyongchao
 * 计算活动频次调控的对象
 */
public class CampaignsFreq {
    /**
     * 频次对象状态
     */
    private int status = 1;
    /**
     * 计算时间差
     */
    private int deltaT;
    /**
     * 活动ID
     */
    private String cid;
    /**
     * win次数
     */
    private AtomicInteger wins = new AtomicInteger(0);
    /**
     * 计算时间戳开始
     */
    private long start;
    /**
     * 计算时间戳结束
     */
    private long end;
    /**
     * 计算开始预算
     */
    private float last;
    /**
     * 计算结束预算
     */
    private float curr;

    private float dailyBudget;

    /**
     * 日投放散列天和hour
     */
    private Map<String, Set<Integer>> dhours = new HashMap<>(7);
    /**
     * 计算时间点
     */
    private LocalDateTime computeStmp;
    /**
     * 预算消耗类型  fast  avg
     */
    private Integer pacingtype;

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getDeltaT() {
        return deltaT;
    }

    public void setDeltaT(int deltaT) {
        this.deltaT = deltaT;
    }

    public String getCid() {
        return cid;
    }

    public void setCid(String cid) {
        this.cid = cid;
    }

    public AtomicInteger getWins() {
        return wins;
    }

    public void setWins(AtomicInteger wins) {
        this.wins = wins;
    }

    public long getStart() {
        return start;
    }

    public void setStart(long start) {
        this.start = start;
    }

    public long getEnd() {
        return end;
    }

    public void setEnd(long end) {
        this.end = end;
    }

    public float getLast() {
        return last;
    }

    public void setLast(float last) {
        this.last = last;
    }

    public float getCurr() {
        return curr;
    }

    public void setCurr(float curr) {
        this.curr = curr;
    }

    public Map<String, Set<Integer>> getDhours() {
        return dhours;
    }

    public void setDhours(Map<String, Set<Integer>> dhours) {
        this.dhours = dhours;
    }

    public LocalDateTime getComputeStmp() {
        return computeStmp;
    }

    public void setComputeStmp(LocalDateTime computeStmp) {
        this.computeStmp = computeStmp;
    }

    public CampaignsFreq(String cid, float dailyBudget) {
        this.dailyBudget = dailyBudget;
        this.cid = cid;
    }

    public CampaignsFreq() {
    }

    public float getDailyBudget() {
        return dailyBudget;
    }

    public void setDailyBudget(float dailyBudget) {
        this.dailyBudget = dailyBudget;
    }

    public Integer getPacingtype() {
        return pacingtype;
    }

    public void setPacingtype(Integer pacingtype) {
        this.pacingtype = pacingtype;
    }
}
